home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freelog 121
/
FreelogMagazineJuilletAout2014-No121.iso
/
Outils
/
Adobe-Air
/
adobe-air_13.exe
/
[0]
/
setup.swf
/
scripts
/
mx
/
accessibility
/
AccImpl.as
next >
Wrap
Text File
|
2014-03-27
|
4KB
|
134 lines
package mx.accessibility
{
import flash.accessibility.Accessibility;
import flash.accessibility.AccessibilityImplementation;
import flash.accessibility.AccessibilityProperties;
import flash.events.Event;
import mx.core.UIComponent;
import mx.core.mx_internal;
use namespace mx_internal;
public class AccImpl extends AccessibilityImplementation
{
private static const STATE_SYSTEM_NORMAL:uint = 0;
private static const STATE_SYSTEM_UNAVAILABLE:uint = 1;
private static const STATE_SYSTEM_FOCUSABLE:uint = 1048576;
private static const STATE_SYSTEM_FOCUSED:uint = 4;
private static const EVENT_OBJECT_NAMECHANGE:uint = 32780;
mx_internal static const VERSION:String = "3.0.0.0";
protected var master:UIComponent;
protected var role:uint;
public function AccImpl(param1:UIComponent)
{
var _loc3_:int = 0;
var _loc4_:int = 0;
super();
this.master = param1;
stub = false;
param1.accessibilityProperties = new AccessibilityProperties();
var _loc2_:Array = eventsToHandle;
if(_loc2_)
{
_loc3_ = _loc2_.length;
_loc4_ = 0;
while(_loc4_ < _loc3_)
{
param1.addEventListener(_loc2_[_loc4_],eventHandler);
_loc4_++;
}
}
}
mx_internal static function createAccessibilityImplementation(param1:UIComponent) : void
{
}
public static function enableAccessibility() : void
{
}
protected function eventHandler(param1:Event) : void
{
switch(param1.type)
{
case "errorStringChanged":
Accessibility.sendEvent(master,0,EVENT_OBJECT_NAMECHANGE);
Accessibility.updateProperties();
break;
case "toolTipChanged":
Accessibility.sendEvent(master,0,EVENT_OBJECT_NAMECHANGE);
Accessibility.updateProperties();
}
}
protected function getName(param1:uint) : String
{
return null;
}
private function getStatusName() : String
{
var _loc1_:String = "";
if(master.toolTip)
{
_loc1_ += " " + master.toolTip;
}
if(master is UIComponent && UIComponent(master).errorString)
{
_loc1_ += " " + UIComponent(master).errorString;
}
return _loc1_;
}
override public function get_accName(param1:uint) : String
{
var _loc2_:String = UIComponentAccImpl.getFormName(master);
if(param1 == 0 && master.accessibilityProperties && master.accessibilityProperties.name && master.accessibilityProperties.name != "")
{
_loc2_ += master.accessibilityProperties.name + " ";
}
_loc2_ += getName(param1) + getStatusName();
return _loc2_ != null && _loc2_ != "" ? _loc2_ : null;
}
protected function get eventsToHandle() : Array
{
return ["errorStringChanged","toolTipChanged"];
}
protected function getState(param1:uint) : uint
{
var _loc2_:uint = STATE_SYSTEM_NORMAL;
if(!UIComponent(master).enabled)
{
_loc2_ |= STATE_SYSTEM_UNAVAILABLE;
}
else
{
_loc2_ |= STATE_SYSTEM_FOCUSABLE;
if(UIComponent(master) == UIComponent(master).getFocus())
{
_loc2_ |= STATE_SYSTEM_FOCUSED;
}
}
return _loc2_;
}
override public function get_accRole(param1:uint) : uint
{
return role;
}
}
}